package com.friend.joey.applicationfriend.ChildActivities;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.Button;

import com.friend.joey.applicationfriend.Adapters.AlertAdapter;
import com.friend.joey.applicationfriend.Adapters.RememAdapter;
import com.friend.joey.applicationfriend.Classes.AlertMessage;
import com.friend.joey.applicationfriend.Classes.RememRecord;
import com.friend.joey.applicationfriend.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Joey on 2017/5/31.
 */

public class ChildAlertActivity extends AppCompatActivity {
    private ArrayList<AlertMessage> messageList = new ArrayList<>();//备忘消息
    private AlertAdapter adapter;
    private RecyclerView megRecyclerView;
    private Button button_new;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.child_alert);
        megRecyclerView=(RecyclerView)findViewById(R.id.calert_recycler_view);
        initMessages();
        LinearLayoutManager layoutManager = new LinearLayoutManager(ChildAlertActivity.this);
        megRecyclerView.setLayoutManager(layoutManager);
        adapter = new AlertAdapter(messageList);
        megRecyclerView.setAdapter(adapter);
    }

    public void initMessages(){
        AlertMessage rem1=new AlertMessage(AlertMessage.TYPE_FORGET,"走出家周围100米","2017/5/23 18:03");
        messageList.add(rem1);
        AlertMessage rem2=new AlertMessage(AlertMessage.TYPE_LOCATION,"走出家周围100米","2017/5/29 11:45");
        messageList.add(rem2);
        AlertMessage rem3=new AlertMessage(AlertMessage.TYPE_MAP,"走出家周围100米","2017/6/1 17:24");
        messageList.add(rem3);
    }
}
